package cn.cq.satoken;

import cn.dev33.satoken.secure.SaSecureUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class SaSecure {

    @Value("${sa-token.aes-key}")
    private String key;

    /**
     * 加密
     * @param text
     * @return
     */
    public String aesEncrypt(String text){
        return SaSecureUtil.aesEncrypt(key, text);
    }

    /**
     * 解密
     * @param text
     * @return
     */
    public String aesDecrypt(String text){
        return SaSecureUtil.aesDecrypt(key, text);
    }

}
